﻿using AutoMapper;
using S.Transplantation.Domain.Models;
using S.Transplantation.Infrastructure.InterFace;
using S.Transplantation.Read.Api.Dto;

namespace S.Transplantation.Read.Api.Extensions.AutoMapper
{
    public class ReadProfile : Profile
    {
        public ReadProfile()
        {
            //如果有相同字段的类就写一个这个
            //CreateMap<CellGrid, CellGrid2>().ReverseMap();//从前往后传输相同字段的值
            CreateMap<DescendantTransferModel, GetTransplantationListDto>().ReverseMap();
            // 使用自定义映射 Student类的ID映射到StudentDTO类的StudentID
            //CreateMap<StudentModel, StudentDto>()
            //    .ForMember(destinationMember: des => des.StudentId,
            //    memberOptions: opt => { opt.MapFrom(mapExpression: map => map.ID); })
            //      .ForMember(destinationMember: des => des.StudentName,
            //    memberOptions: opt => { opt.MapFrom(mapExpression: map => map.Name); })
            //        .ForMember(destinationMember: des => des.StudentAge,
            //    memberOptions: opt => { opt.MapFrom(mapExpression: map => map.Age); }).ReverseMap();
        }
    }
}